
      window.onload = function () {
        // 定时器 每隔一秒执行一次
        setInterval(() => {
          
          let date = new Date()
          let HH = date.getHours()
          let mm = date.getMinutes()
          let ss = date.getSeconds()

          // 为页面上的元素赋值
          let H = document.querySelector('#HH');
          H.innerHTML = HH < 10 ? '0' + HH : HH;
          let m = document.querySelector('#mm');
          m.innerHTML = mm < 10 ? '0' + mm : mm;
          let s = document.querySelector('#ss');
          s.innerHTML = ss < 10 ? '0' + ss : ss;


        }, 1000);
      }
    